<template>
  <div class="addArea">
    <section class="header">
      <i class="iconfont iconfanhui1" @click="goBack()"></i>
      <span @click="goBack()">新增缴纳区域</span>
    </section>
    <div class="main-content clearfix">
      <div class="input-box">
        <section>
          <span class="title">缴纳城市</span>
          <span class="value">
            <el-cascader
              v-model="payTheCity"
              :options="addressOptions"
              :props="{ value: 'areaCode', label: 'areaName' }"
              @change="handleChange"
            ></el-cascader>
          </span>
        </section>
      </div>
      <div class="clearfix"></div>
      <!-- <div class="input-box">
        <section>
          <span class="title">特殊区域</span>
          <span class="value">
            <el-select v-model="isSpecialArea" placeholder="请选择">
              <el-option
                v-for="item in typeOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div> -->
      <div class="input-box">
        <section>
          <span class="title">户籍类型</span>
          <span class="value">
            <el-select v-model="censusRegisterType" placeholder="请选择">
              <el-option
                v-for="item in censusOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保截止日</span>
          <span class="value">
            <el-input
              placeholder="请填写日"
              v-model.number="sbEndDate"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保可补月数</span>
          <span class="value">
            <el-input
              placeholder="请填写数量"
              v-model.trim="sbPayBackNum"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="sbBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="sbBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="sbBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保可跨年补缴</span>
          <span class="value">
            <el-select v-model="sbIsSpanYear" placeholder="请选择">
              <el-option
                v-for="item in yearParameter"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="sbCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
              v-model.trim="sbPersonalProportion"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="pensionBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="pensionBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="pensionBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="pensionCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
              v-model.trim="pensionPersonalProportion"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="medicalBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="medicalBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="medicalBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="medicalCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="medicalPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="unemploymentBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="unemploymentBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="unemploymentBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="unemploymentCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="unemploymentPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="workInjuryBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="workInjuryBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="workInjuryBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="workInjuryCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="workInjuryPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="birthBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="birthBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="birthBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="birthCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="birthPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="czjBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="czjBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="czjBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="czjCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="czjPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="ghfBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="ghfBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="ghfBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="ghfCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="ghfPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="dbBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="dbBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="dbBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="dbCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="dbPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金截止日</span>
          <span class="value">
            <el-input
              placeholder="请填写日"
              v-model.number="gjjEndDate"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金可补月数</span>
          <span class="value">
            <el-input
              placeholder="请填写数量"
              v-model.trim="gjjPayBackNum"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="gjjBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="gjjBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="gjjBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金可跨年补缴</span>
          <span class="value">
            <el-select v-model="gjjIsSpanYear" placeholder="请选择">
              <el-option
                v-for="item in yearParameter"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="gjjCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="gjjPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
    </div>
    <div class="button-box">
      <div class="comfirm" @click="sum()">保存</div>
      <div class="cancel" @click="goBack()">返回</div>
    </div>
  </div>
</template>

<script>
import base from "@/assets/js/base";
import { requestApiPost } from "../api/api";
import { reqRep } from "../report/reqReport";
import { resRep } from "../report/resReport";
import commonData from "@/assets/js/commonData";
export default {
  name: "addArea",
  data() {
    return {
      addressOptions: [], //缴纳城市
      payTheCity: [], //选择城市
      gjjPersonalProportion: "",
      gjjCompanyProportion: "",
      sbCompanyProportion: "",
      sbPersonalProportion: "",
      pensionBaseValue: "",
      pensionBaseStart: "",
      pensionBaseEnd: "",
      pensionCompanyProportion: "",
      pensionPersonalProportion: "",
      medicalBaseValue: "",
      medicalBaseEnd: "",
      medicalBaseStart: "",
      medicalCompanyProportion: "",
      medicalPersonalProportion: "",
      unemploymentBaseValue: "",
      unemploymentBaseStart: "",
      unemploymentBaseEnd: "",
      unemploymentCompanyProportion: "",
      unemploymentPersonalProportion: "",
      workInjuryBaseValue: "",
      workInjuryBaseStart: "",
      workInjuryBaseEnd: "",
      workInjuryCompanyProportion: "",
      workInjuryPersonalProportion: "",
      birthBaseValue: "",
      birthBaseEnd: "",
      birthBaseStart: "",
      birthCompanyProportion: "",
      birthPersonalProportion: "",
      czjBaseValue: "",
      czjBaseStart: "",
      czjBaseEnd: "",
      czjCompanyProportion: "",
      czjPersonalProportion: "",
      ghfBaseValue: "",
      ghfBaseStart: "",
      ghfBaseEnd: "",
      ghfCompanyProportion: "",
      ghfPersonalProportion: "",
      dbBaseValue: "",
      dbBaseStart: "",
      dbBaseEnd: "",
      dbCompanyProportion: "",
      dbPersonalProportion: "",
      sbEndDate: "",
      gjjEndDate: "",
      socialSecurity: true,
      accumulationFund: true,
      sbBaseStart: "",
      sbBaseEnd: "",
      gjjBaseStart: "",
      gjjBaseEnd: "",
      sbPayBackNum: "",
      gjjPayBackNum: "",
      sbBaseValue: "",
      gjjBaseValue: "",
      sbIsSpanYear: "",
      gjjIsSpanYear: "",
      censusRegisterType: "",
      isSpecialArea: "2",
      typeOptions: [
        {
          value: "1",
          label: "正常",
        },
        {
          value: "2",
          label: "特殊",
        },
      ],
      censusOptions: [],
      yearParameter: [
        {
          value: "0",
          label: "否",
        },
        {
          value: "1",
          label: "是",
        },
      ],
    };
  },
  methods: {
    isClick(num) {
      this.isNumber = num;
    },
    switchFun(i) {
      this.switchIndex = i;
    },
    //比例
    percentageFilter(e) {
      if (e < 0 || e > 100) {
        this.$message({
          message: "请填写正确比例",
          type: "warning",
          duration: 1500,
        });
      }
    },
    //获取缴纳城市名称
    handleChange(e) {
      for (let i = 0; i < this.addressOptions.length; i++) {
        if (this.addressOptions[i].value == e[0]) {
          this.province = this.addressOptions[i].label;
          for (let j = 0; j < this.addressOptions[i].children.length; j++) {
            if (this.addressOptions[i].children[j].value == e[1]) {
              this.city = this.addressOptions[i].children[j].label;
            }
          }
        }
      }
    },
    sum() {
      if (this.payTheCity.length != 2) {
        this.$message({
          message: "请选择缴纳城市",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.censusRegisterType) {
        this.$message({
          message: "请选择户籍类型",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.sbEndDate) {
        this.$message({
          message: "请选择社保截止日",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.sbPayBackNum) {
        this.$message({
          message: "请填写社保可补月数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseInt(this.sbPayBackNum) > 10 ||
        parseInt(this.sbPayBackNum) < 1 ||
        !base.isInteger(this.sbPayBackNum)
      ) {
        this.$message({
          message: "社保可补月数必须在1到10之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.sbBaseValue) {
        this.$message({
          message: "请填写社保默认基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.sbBaseStart || !this.sbBaseEnd) {
        this.$message({
          message: "请填写社保基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.gjjEndDate) {
        this.$message({
          message: "请填写公积金截止日",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.gjjPayBackNum) {
        this.$message({
          message: "请填写公积金可补月数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseInt(this.gjjPayBackNum) > 10 ||
        parseInt(this.gjjPayBackNum) < 1 ||
        !base.isInteger(this.gjjPayBackNum)
      ) {
        this.$message({
          message: "公积金可补月数必须在1到10之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.gjjBaseValue) {
        this.$message({
          message: "请填写公积金默认基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.gjjBaseStart || !this.gjjBaseEnd) {
        this.$message({
          message: "请填写公积金基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (parseFloat(this.sbBaseStart) > parseFloat(this.sbBaseEnd)) {
        this.$message({
          message: "社保起始基数必须小于终止基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseFloat(this.sbBaseValue) < parseFloat(this.sbBaseStart) ||
        parseFloat(this.sbBaseValue) > parseFloat(this.sbBaseEnd)
      ) {
        this.$message({
          message: "社保默认基数必须介于社保基数之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (parseFloat(this.gjjBaseStart) > parseFloat(this.gjjBaseEnd)) {
        this.$message({
          message: "公积金起始基数必须小于终止基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseFloat(this.gjjBaseValue) < parseFloat(this.gjjBaseStart) ||
        parseFloat(this.gjjBaseValue) > parseFloat(this.gjjBaseEnd)
      ) {
        this.$message({
          message: "公积金默认基数必须介于社保基数之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      base
        .postAjax("/businessManger/payRuleSave", {
          gjjCompanyProportion: this.gjjCompanyProportion,
          gjjPersonalProportion: this.gjjPersonalProportion,
          isSpecialArea: this.isSpecialArea,
          companyId: sessionStorage.getItem("areaCompanyId"),
          province: this.province,
          city: this.city,
          provinceCode: this.payTheCity[0],
          cityCode: this.payTheCity[1],
          censusRegisterType: this.censusRegisterType,
          sbPayBackNum: this.sbPayBackNum,
          gjjPayBackNum: this.gjjPayBackNum,
          sbEndDate: this.sbEndDate,
          gjjEndDate: this.gjjEndDate,
          sbBaseStart: this.sbBaseStart,
          sbBaseEnd: this.sbBaseEnd,
          gjjBaseStart: this.gjjBaseStart,
          gjjBaseEnd: this.gjjBaseEnd,
          sbBaseValue: this.sbBaseValue,
          gjjBaseValue: this.gjjBaseValue,
          sbIsSpanYear: this.sbIsSpanYear,
          gjjIsSpanYear: this.gjjIsSpanYear,

          sbCompanyProportion: this.sbCompanyProportion,
          sbPersonalProportion: this.sbPersonalProportion,
          pensionBaseValue: this.pensionBaseValue,
          pensionBaseStart: this.pensionBaseStart,
          pensionBaseEnd: this.pensionBaseEnd,
          pensionCompanyProportion: this.pensionCompanyProportion,
          pensionPersonalProportion: this.pensionPersonalProportion,
          medicalBaseValue: this.medicalBaseValue,
          medicalBaseEnd: this.medicalBaseEnd,
          medicalBaseStart: this.medicalBaseStart,
          medicalCompanyProportion: this.medicalCompanyProportion,
          medicalPersonalProportion: this.medicalPersonalProportion,
          unemploymentBaseValue: this.unemploymentBaseValue,
          unemploymentBaseStart: this.unemploymentBaseStart,
          unemploymentBaseEnd: this.unemploymentBaseEnd,
          unemploymentCompanyProportion: this.unemploymentCompanyProportion,
          unemploymentPersonalProportion: this.unemploymentPersonalProportion,
          workInjuryBaseValue: this.workInjuryBaseValue,
          workInjuryBaseStart: this.workInjuryBaseStart,
          workInjuryBaseEnd: this.workInjuryBaseEnd,
          workInjuryCompanyProportion: this.workInjuryCompanyProportion,
          workInjuryPersonalProportion: this.workInjuryPersonalProportion,
          birthBaseValue: this.birthBaseValue,
          birthBaseEnd: this.birthBaseEnd,
          birthBaseStart: this.birthBaseStart,
          birthCompanyProportion: this.birthCompanyProportion,
          birthPersonalProportion: this.birthPersonalProportion,
          czjBaseValue: this.czjBaseValue,
          czjBaseStart: this.czjBaseStart,
          czjBaseEnd: this.czjBaseEnd,
          czjCompanyProportion: this.czjCompanyProportion,
          czjPersonalProportion: this.czjPersonalProportion,
          ghfBaseValue: this.ghfBaseValue,
          ghfBaseStart: this.ghfBaseStart,
          ghfBaseEnd: this.ghfBaseEnd,
          ghfCompanyProportion: this.ghfCompanyProportion,
          ghfPersonalProportion: this.ghfPersonalProportion,
          dbBaseValue: this.dbBaseValue,
          dbBaseStart: this.dbBaseStart,
          dbBaseEnd: this.dbBaseEnd,
          dbCompanyProportion: this.dbCompanyProportion,
          dbPersonalProportion: this.dbPersonalProportion,
        })
        .then((res) => {
          if (res.data.code == 1) {
            this.$message({
              message: res.data.message,
              type: "success",
              duration: 1500,
            });
            setTimeout(() => {
              this.goBack();
            }, 1500);
          }
        })
        .catch((err) => {
          this.$message.error(err.data.message);
        });
    },
    goBack() {
      this.$router.go(-1);
    },
  },
  created() {
    this.censusOptions=commonData.censusOptions;
    this.addressOptions = base.getAddress();
  },
};
</script>
<style scoped>
.header {
  padding: 15px;
  height: 50px;
  box-sizing: border-box;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}
.header i {
  margin-right: 5px;
}
.header i:hover {
  color: #13cb6e;
}
.header span {
  cursor: pointer;
}
.main-content {
  padding: 30px;
}
h2 {
  display: block;
  color: #333;
  font-size: 16px;
  margin: 30px 0;
  clear: both;
}
.input-box {
  float: left;
  margin-right: 40px;
  margin-bottom: 20px;
}
.search-box .input-box {
  margin: 0;
  height: auto;
}
.nbsp {
  float: none;
  display: block;
}
.input-box .title {
  display: inline-block;
  margin-right: 7px;
  width: 100px;
  color: #666;
}

.input-box .value input {
  width: 228px;
}
.input-box .value {
  display: inline-block;
}
.input-box .value .base {
  width: 106px;
}
.error {
  text-align: center;
}
.button-box {
  clear: both;
  border-top: 1px solid #eee;
  padding: 30px;
  margin: 0 auto;
}
.button-box div {
  display: inline-block;
  width: 80px;
  padding: 8px 10px;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  margin-right: 30px;
}
.comfirm {
  color: #fff;
  background-color: #13cb6e;
}
.cancel {
  color: #fff;
  background-color: #999;
}
.add {
  color: #fff;
  background-color: deepskyblue;
}
.tip {
  color: #f56c6c;
  font-size: 12px;
}
.sm-f {
  padding: 30px;
}
.sm-f > ul {
  display: inline-block;
  margin-right: 15px;
  color: #666;
}
.sm-f .value {
  color: #666;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}
.sm-f .no {
  opacity: 0;
}
.sm-f .button {
  float: right;
  width: 140px;
  text-align: center;
  height: 50px;
  font-size: 20px;
  line-height: 50px;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  background-color: #13cb6e;
}
.footer {
  padding: 10px 30px 30px;
  color: #999;
}
.footer span {
  margin-right: 50px;
}
.hint {
  padding: 0 30px 10px;
  color: #999;
}
.el-input,
.el-select {
  width: 228px;
}
</style>